//
//  HJStatusBottomView.swift
//  sinaWeibo
//
//  Created by hjun on 16/3/26.
//  Copyright © 2016年 hjun. All rights reserved.
//

import UIKit

class HJStatusBottomView: UIView {

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
   
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        prepareUI()
    }

    
    
    private func prepareUI(){
        
        ///添加子控件
        addSubview(forwarderBtn)
        addSubview(commentBtn)
        addSubview(praiseBtn)
        addSubview(separatorViewFirst)
        addSubview(separatorViewSecond)
        ///添加约束
        forwarderBtn.snp_makeConstraints { (make) -> Void in
            
            make.bottom.leading.top.equalTo(self)
        
        }
        
        commentBtn.snp_makeConstraints { (make) -> Void in
            make.top.bottom.equalTo(self)
            make.leading.equalTo(forwarderBtn.snp_trailing)
            make.width.equalTo(forwarderBtn)
        }
        
        praiseBtn.snp_makeConstraints { (make) -> Void in
            make.top.bottom.trailing.equalTo(self)
            make.leading.equalTo(commentBtn.snp_trailing)
            make.width.equalTo(forwarderBtn)
        }
        
        separatorViewFirst.snp_makeConstraints { (make) -> Void in
            
            make.centerX.equalTo(forwarderBtn.snp_trailing)
            make.centerY.equalTo(forwarderBtn)
        }
        
        separatorViewSecond.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(commentBtn.snp_trailing)
            make.centerY.equalTo(commentBtn)
        }
        
        
    }
    
       //MARK:懒加载
      ///转发
    private lazy var forwarderBtn: UIButton = UIButton(title: "转发", image: "timeline_icon_retweet", bkgImage: "timeline_card_bottom_background")
    
    ///评论
    private lazy var commentBtn: UIButton = UIButton(title: "评论", image: "timeline_icon_comment", bkgImage: "timeline_card_bottom_background")
    
     ///赞
    private lazy var praiseBtn: UIButton = UIButton(title: "赞", image: "timeline_icon_unlike", bkgImage: "timeline_card_bottom_background")
   
    ///分割线1
    private lazy var separatorViewFirst: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    
    ///分隔线2
    private lazy var separatorViewSecond: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))

}
